Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elastic Agent] Fix broken enrollment command #26749

Merged
merged 4 commits into from
Jul 7, 2021

Conversation

blakerouse
Copy link
Contributor

What does this PR do?

The proxy work broke the enroll command that prevents enrollment from working when running Fleet Server with default options.

Why is it important?

Otherwise the enrollment command will not work also breaking the container.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@blakerouse blakerouse added bug Team:Elastic-Agent Label for the Agent team backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify labels Jul 6, 2021
@blakerouse blakerouse self-assigned this Jul 6, 2021
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jul 6, 2021
@blakerouse blakerouse marked this pull request as ready for review July 6, 2021 19:50
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 6, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-07-07T12:39:35.128+0000

  • Duration: 68 min 11 sec

  • Commit: 208b8bc

Test stats 🧪

Test Results
Failed 0
Passed 6972
Skipped 16
Total 6988

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 6972
Skipped 16
Total 6988

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruflin as we're talking about running integration tests in terms of Package Registry -
this PR is a good candidate for enabling basic integration tests to make sure if API isn't broken.

x-pack/elastic-agent/pkg/agent/cmd/enroll_cmd.go Outdated Show resolved Hide resolved
@blakerouse
Copy link
Contributor Author

/package

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like updated log verbosity

@michalpristas
Copy link
Contributor

tested ok

@blakerouse blakerouse merged commit 584ae74 into elastic:master Jul 7, 2021
@blakerouse blakerouse deleted the agent-fix-enroll-cmd branch July 7, 2021 15:01
mergify bot pushed a commit that referenced this pull request Jul 7, 2021
* Improve log to include URL.

* Fix issue with enroll command.

* Add changelog entry.

* Fix retry log message.

(cherry picked from commit 584ae74)
mergify bot pushed a commit that referenced this pull request Jul 7, 2021
* Improve log to include URL.

* Fix issue with enroll command.

* Add changelog entry.

* Fix retry log message.

(cherry picked from commit 584ae74)
blakerouse added a commit that referenced this pull request Jul 7, 2021
* Improve log to include URL.

* Fix issue with enroll command.

* Add changelog entry.

* Fix retry log message.

(cherry picked from commit 584ae74)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
blakerouse added a commit that referenced this pull request Jul 7, 2021
* Improve log to include URL.

* Fix issue with enroll command.

* Add changelog entry.

* Fix retry log message.

(cherry picked from commit 584ae74)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
@ruflin
Copy link
Member

ruflin commented Jul 8, 2021

@blakerouse How do we prevent these kind of things to break again? It seems a pretty fundamental thing that was broken and I assume should be uncovered by automated tests even before merging?

@blakerouse
Copy link
Contributor Author

@ruflin This should have been caught by the e2e testing suite. It was not because from what I can tell it seems that the e2e testing suite is not actually running with the package builds from the repository.

You can see from the e2e testing logs in this PR that the log line Retrying to enroll... was still shown, that means that the change from this PR was not actually tested by the e2e suite (I assume it is using the last built snapshot), as the log line was change to Starting enrollment to URL: {url}.

This needs to be fixed in the e2e repository and the e2e tests should probably now always run. Being that Elastic Agent is going GA things like this should not break.

v1v added a commit to v1v/beats that referenced this pull request Jul 8, 2021
* upstream/master: (430 commits)
  CI: increase timeout (elastic#26764)
  Heartbeat: add datastream fields to synthetics (elastic#26774)
  Osquerybeat: Change the query timeout from 3 secs to 60 secs (elastic#26775)
  Remove experimental warning for inputs with variables. (elastic#26762)
  Add latest k8s versions in testing (elastic#26729)
  change type of max_bytes to ByteType (elastic#26699)
  [Elastic Agent] Fix broken enrollment command (elastic#26749)
  Update agent managed manifest to include enrolment token variable (elastic#26756)
  Filebeat: Ensure module pipelines compatibility with previous versions of Elasticsearch (elastic#26737)
  Forward port changelog for 7.13.3 (elastic#26731) to master (elastic#26754)
  Upgrade PyYAML dependency used for tests (elastic#26746)
  Add agent fleet enrolment k8s manifest (elastic#26566)
  CI: retry the step only (elastic#26736)
  Osquerybeat: Fix the configuration poll interval setting (elastic#26739)
  [Filebeat] Replace copy_from with templated value (elastic#26631)
  Reduce the verbosity of the debug log for monitoring (elastic#26583)
  Add instructions on testing metricbeat kubernetes module (elastic#26643)
  Revert "[CI] fight the flakiness with some retry option in the CI only for the Pull Requests (elastic#26617)" (elastic#26704)
  Packaging: linux/armv7 is not supported (elastic#26706)
  Cyberarkpas: Link to official docs on how to setup TLS (elastic#26614)
  ...
@ruflin
Copy link
Member

ruflin commented Jul 14, 2021

@blakerouse Can you follow up on this to make sure it is fixed wherever it needs fixing?

@blakerouse
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify bug Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fleet fails to enroll in 8.0.0-SNAPSHOT version
6 participants